package com.linghang.association.service;
import com.linghang.association.domain.Role;
import com.linghang.association.domain.RoleExample;
import com.linghang.association.mapper.ResourceMapper;
import com.linghang.association.mapper.RoleMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * @author LinyaT052
 * @date 2022年07月24日 11:36
 * 角色与授权相关逻辑实现层
 */
@Service
public class AuthorityService {
        @Resource
        private  RoleMapper roleMapper;
        @Resource
        private  ResourceMapper resourceMapper;
    /**
     * 获取所有权限的信息
     * @return
     */
    public List<com.linghang.association.domain.Resource> getResource(String username) {
        return resourceMapper.selectByUsername(username);
    }
    /**
     * 根据用户名返回对应身份
     */
    public String getRole(String username){
        return roleMapper.selectRoleByUsername(username);
    }
}
